class SweetPotato():
    def __init__(self):
        '''
        初始化属性
        '''
        self.cook_time = 0

        self.cook_static = "生的"

        self.condiments = []

    def cook(self, time):
        '''
        烤地瓜方法
        :param time:
        :return:
        '''
        self.cook_time += time
        if 0 <= self.cook_time < 3:
            self.cook_static = "生的"
        elif 3 <= self.cook_time < 5:
            self.cook_static = "半生不熟"
        elif 5 <= self.cook_time < 8:
            self.cook_static = "熟了"
        elif 8 <= self.cook_time:
            self.cook_staticc = "糊了"

    def add_condiments(self, condiment):
        self.condiments.append(condiment)

    def __str__(self):
        return f"这个地瓜考了{self.cook_time}时间，状态是{self.cook_static}，调料有{self.condiments}"


potato = SweetPotato()
print(potato)

potato.cook(2)
potato.add_condiments("辣椒")
print(potato)

potato.cook(2)
potato.add_condiments("醋")
print(potato)
